'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview 获取等级相应的奖励等级
 * @author sundbcn@gmail.com (sun debing)
 */

var _ = require('lodash');
var dataApi = require('../libs/dataApi');

exports.getRewardLv = function (role_lv) {
    var lv = Math.round(role_lv / 10) * 10;
    var max_lv = dataApi.hero_lvl.length();
    if (lv <= 0) {
        lv = 1;
    } else if (lv > max_lv) {
        lv = max_lv;
    }
    return lv;
};
